#!/bin/sh
# save the results of runs in directory $1 to $2

function usage() {
	echo "usage: save dir1 dir2"
	exit 0
}

src=$1
shift
dst=$1
shift

if [ -z "$src" -o -z "$dst" ]; then
	usage
fi
for f in  ${src}/p*.out
do
	x=`basename $f .out`
	n=`echo $x | cut -f2 -dp`
	echo "copy run $n"
	cp $f data.save/run${n}.out
done
